package com.fqxl.labour.service.impl;

import com.fqxl.labour.domain.LabourCustomer;
import com.fqxl.labour.domain.vo.PageVo;
import com.fqxl.labour.mapper.CustomerMapper;
import com.fqxl.labour.service.CustomerService;
import com.fqxl.labour.untils.R;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CustomerServiceImpl implements CustomerService {

    @Autowired
    private CustomerMapper customerMapper;

    @Override
    public R selectCustomer(PageVo pageVo) {

        PageHelper.startPage(pageVo.getPage(), pageVo.getSize());
        List<LabourCustomer> labourCustomers = customerMapper.selectCustomer();
        PageInfo pageInfo = new PageInfo(labourCustomers);

        return R.ok(pageInfo);
    }
}
